from sqlalchemy.orm import Session

from dao.task_video_dao import TaskVideoDAO


class TaskVideoService:
    def __init__(self):
        self.dao = TaskVideoDAO()

    def create_task_videos(self, videos: list):
        return self.dao.create_task_videos(videos)

    def update_task_videos(self, videos: list):
        return self.dao.update_task_videos(videos)

    def update_video_path(self, id, path):
        return self.dao.update_video_path(id, path)

    def check_task_video_exists(self, video_id: int):
        return self.dao.check_task_video_exists(video_id)

    def get_all_ids(self):
        return self.dao.get_all_ids();

    def get_ids_by_type_name(self, type_name=None):
        return self.dao.get_ids_by_type_name(type_name);

    def get_all_task_videos(self):
        return self.dao.get_all_task_videos()

    def get_null_task_videos(self):
        return self.dao.get_null_task_videos()

    def get_all_video_path_list(self):
        return self.dao.get_all_video_path_list()

    def get_task_videos_paginated(self, skip: int = 0, limit: int = 100):
        return self.dao.get_task_videos_paginated(skip, limit)

    def delete_task_video_by_id(self, video_id: int):
        return self.dao.delete_task_video_by_id(video_id)

    def update_task_video_is_down_by_id(self, video_id: int, is_down: int=1):
        return self.dao.update_task_video_is_down_by_id(video_id, is_down)

    def get_all_video_is_down_list(self):
        return self.dao.get_all_video_is_down_list()

